package com.leyou.page.config;

import com.leyou.common.auth.utils.RsaUtils;
import lombok.Data;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.stereotype.Component;

import javax.annotation.PostConstruct;
import java.security.PublicKey;

@Data
@Component
@ConfigurationProperties(prefix = "ly.jwt")
public class JwtProperties {
    private String pubKeyPath;
    private PublicKey publicKey;

    /**
     * 读取公钥
     * @throws Exception
     */
    @PostConstruct
    public void initMethod() throws Exception{
         publicKey = RsaUtils.getPublicKey(pubKeyPath);
    }
    //接收cookie的数据
 private CookiePojo cookiePojo=new CookiePojo();
    @Data
    public class CookiePojo{
        private String cookieName;
    }

    private AppPojo app = new AppPojo();

    @Data
    public class AppPojo{
        private String serviceName;
        private String secret;
    }

}
